package com.ruoyi.building.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.building.mapper.GroupPurchaseMapper;
import com.ruoyi.building.domain.GroupPurchase;
import com.ruoyi.building.service.IGroupPurchaseService;

/**
 * 团购列表Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-12
 */
@Service
public class GroupPurchaseServiceImpl implements IGroupPurchaseService 
{
    @Autowired
    private GroupPurchaseMapper groupPurchaseMapper;

    /**
     * 查询团购列表
     * 
     * @param groupPurchaseId 团购列表主键
     * @return 团购列表
     */
    @Override
    public GroupPurchase selectGroupPurchaseByGroupPurchaseId(Long groupPurchaseId)
    {
        return groupPurchaseMapper.selectGroupPurchaseByGroupPurchaseId(groupPurchaseId);
    }

    /**
     * 查询团购列表列表
     * 
     * @param groupPurchase 团购列表
     * @return 团购列表
     */
    @Override
    public List<GroupPurchase> selectGroupPurchaseList(GroupPurchase groupPurchase)
    {
        return groupPurchaseMapper.selectGroupPurchaseList(groupPurchase);
    }

    /**
     * 新增团购列表
     * 
     * @param groupPurchase 团购列表
     * @return 结果
     */
    @Override
    public int insertGroupPurchase(GroupPurchase groupPurchase)
    {
        groupPurchase.setCreateTime(DateUtils.getNowDate());
        return groupPurchaseMapper.insertGroupPurchase(groupPurchase);
    }

    /**
     * 修改团购列表
     * 
     * @param groupPurchase 团购列表
     * @return 结果
     */
    @Override
    public int updateGroupPurchase(GroupPurchase groupPurchase)
    {
        groupPurchase.setUpdateTime(DateUtils.getNowDate());
        return groupPurchaseMapper.updateGroupPurchase(groupPurchase);
    }

    /**
     * 批量删除团购列表
     * 
     * @param groupPurchaseIds 需要删除的团购列表主键
     * @return 结果
     */
    @Override
    public int deleteGroupPurchaseByGroupPurchaseIds(Long[] groupPurchaseIds)
    {
        return groupPurchaseMapper.deleteGroupPurchaseByGroupPurchaseIds(groupPurchaseIds);
    }

    /**
     * 删除团购列表信息
     * 
     * @param groupPurchaseId 团购列表主键
     * @return 结果
     */
    @Override
    public int deleteGroupPurchaseByGroupPurchaseId(Long groupPurchaseId)
    {
        return groupPurchaseMapper.deleteGroupPurchaseByGroupPurchaseId(groupPurchaseId);
    }
}
